package com.hzsk.lisence.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzsk.lisence.entity.LisenceLogEntity;
import com.hzsk.lisence.entity.query.LisenceServiceQuery;
import com.hzsk.lisence.mapper.LisenceLogMapper;
import com.hzsk.lisence.service.LicenseLogSysService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LicenseLogSysServiceImpl implements LicenseLogSysService {

    @Resource
    public LisenceLogMapper lisenceLogMapper;

    @Override
    public Integer save(LisenceLogEntity lrpLogSys) {
        return lisenceLogMapper.save(lrpLogSys);
    }

    @Override
    public Object getLogInfo(LisenceServiceQuery lisenceServiceQuery) {
        PageHelper.startPage(lisenceServiceQuery.getPageNum(), lisenceServiceQuery.getPageSize());
        List<LisenceLogEntity> infos =  lisenceLogMapper.getLogInfoByType(lisenceServiceQuery);
        return new PageInfo<>(infos);
    }
}
